import 'package:xin_he/generated/json/base/json_convert_content.dart';
import 'package:xin_he/page/mine/xin_he_adress_management/model/xin_he_p_c_a_model_entity.dart';

XinHePCAModelEntity $XinHePCAModelEntityFromJson(Map<String, dynamic> json) {
	final XinHePCAModelEntity xinHePCAModelEntity = XinHePCAModelEntity();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		xinHePCAModelEntity.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		xinHePCAModelEntity.name = name;
	}
	final String? extName = jsonConvert.convert<String>(json['extName']);
	if (extName != null) {
		xinHePCAModelEntity.extName = extName;
	}
	final List<XinHePCAModelChildren>? children = jsonConvert.convertListNotNull<XinHePCAModelChildren>(json['children']);
	if (children != null) {
		xinHePCAModelEntity.children = children;
	}
	return xinHePCAModelEntity;
}

Map<String, dynamic> $XinHePCAModelEntityToJson(XinHePCAModelEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['extName'] = entity.extName;
	data['children'] =  entity.children?.map((v) => v.toJson()).toList();
	return data;
}

XinHePCAModelChildren $XinHePCAModelChildrenFromJson(Map<String, dynamic> json) {
	final XinHePCAModelChildren xinHePCAModelChildren = XinHePCAModelChildren();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		xinHePCAModelChildren.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		xinHePCAModelChildren.name = name;
	}
	final String? extName = jsonConvert.convert<String>(json['extName']);
	if (extName != null) {
		xinHePCAModelChildren.extName = extName;
	}
	final List<XinHePCAModelChildrenChildren>? children = jsonConvert.convertListNotNull<XinHePCAModelChildrenChildren>(json['children']);
	if (children != null) {
		xinHePCAModelChildren.children = children;
	}
	return xinHePCAModelChildren;
}

Map<String, dynamic> $XinHePCAModelChildrenToJson(XinHePCAModelChildren entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['extName'] = entity.extName;
	data['children'] =  entity.children?.map((v) => v.toJson()).toList();
	return data;
}

XinHePCAModelChildrenChildren $XinHePCAModelChildrenChildrenFromJson(Map<String, dynamic> json) {
	final XinHePCAModelChildrenChildren xinHePCAModelChildrenChildren = XinHePCAModelChildrenChildren();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		xinHePCAModelChildrenChildren.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		xinHePCAModelChildrenChildren.name = name;
	}
	final String? extName = jsonConvert.convert<String>(json['extName']);
	if (extName != null) {
		xinHePCAModelChildrenChildren.extName = extName;
	}
	final List<dynamic>? children = jsonConvert.convertListNotNull<dynamic>(json['children']);
	if (children != null) {
		xinHePCAModelChildrenChildren.children = children;
	}
	return xinHePCAModelChildrenChildren;
}

Map<String, dynamic> $XinHePCAModelChildrenChildrenToJson(XinHePCAModelChildrenChildren entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['extName'] = entity.extName;
	data['children'] =  entity.children;
	return data;
}